<?php
namespace Admin\Controller;
use Think\Controller;
class EnterController extends AuthController {
    public function index(){
    	$sdate = I('sdate');
    	if(!$sdate){
    		$sdate = date("Y-m")."-01";
    	}
    	$edate = I('edate');
    	if(!$edate){
    		$edate = date("Y-m-d");
    	}
    	$where['cdate'] = array("BETWEEN",array($sdate,$edate));
    	$list = M('Enter')->where($where)->order('cdate desc,ctime desc')->select();
    	$this->assign('list',$list);
    	$this->assign("sdate",$sdate);
    	$this->assign("edate",$edate);
    	$this->display();
    }
    public function change(){
    	$sdate = I('sdate');
    	if(!$sdate){
    		$sdate = date("Y-m")."-01";
    	}
    	$edate = I('edate');
    	if(!$edate){
    		$edate = date("Y-m-d");
    	}
    	$where['cdate'] = array("BETWEEN",array($sdate,$edate));
    	$list = M('Enter')->where($where)->order('cdate desc,ctime desc')->select();
    	$this->ajaxReturn($list);
    }
}